﻿using AdminWeb.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using XW.Web.Framework;
using XW.Web.Framework.Jwt; 
using XW.Core;
using XW.Data; 
using XW.Utils; 

namespace AdminWeb.Controllers
{
    [Authorize]
    public class MockController :BaseController
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public IActionResult List()
        {
            var list = new List<object>();
            for (int i = 0; i < 100; i++)
            {
                list.Add(new {
                    index = i,
                    status = RandomHelper.GetRandInt(0, 4),
                    no = "BH00"+RandomHelper.GetNumber(2),
                    name = i+"办公用品采购项目",
                    paymentType = RandomHelper.GetRandInt(0, 1),
                    contractType = RandomHelper.GetRandInt(0,2),
                    updateTime = RandomHelper.GetRandTime(new DateTime(2005,01,01), DateTime.Now),
                    amount = RandomHelper.GetRandInt(0, 999),
                    adminName = RandomHelper.GetRandStr(10),
                });
            }
            return GetSuccessResult(list);
        }
    }
}
